﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Remove : Form
    {
        public delegate void removeDataHandler(Data data);
        public removeDataHandler myRemoveData;
        public event removeDataHandler removeDataEvent;
        private Data d;
        int selectedColor;
        public Remove(Data d)
        {
            this.d = d;
            InitializeComponent();
            valueLabel.Text = d.label;
            valueX.Text = d.x.ToString();

            valueY.Text = d.y.ToString();
            selectedColor = d.color;
            colorControl1.Color = d.color;
        }

        private void okRemove_Click(object sender, EventArgs e)
        {
            if (valueLabel.Text.Length > 0 && valueX.Text.Length > 0 && valueY.Text.Length > 0)
            {
               // Data d = new Data(valueLabel.Text, int.Parse(valueX.Text), int.Parse(valueY.Text));
                removeDataEvent(d);
                this.Close();
            }
        }
        void color(int col)
        {
            selectedColor = col;
            colorLabel.Text = col.ToString();
        }
        private void colorControl1_Load(object sender, EventArgs e)
        {
            colorLabel.Text = colorControl1.Color.ToString();
        }
    }
}
